﻿using DevComponents.DotNetBar.Controls;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MQTTTool.Static
{
    public static class  RichBoxStatic
	{
		public static void AppendTextColorful(this RichTextBoxEx rtBox, string text, Color color, bool addNewLine = true)
		{
			if (addNewLine) { text += Environment.NewLine; }
			rtBox.SelectionStart = rtBox.TextLength;
			rtBox.SelectionLength = 0;
			rtBox.SelectionColor = color;
			rtBox.AppendText(text);
			rtBox.SelectionColor = rtBox.ForeColor;
		}
	}
}
